Repository navigation
feat(cleanup): add a Clean up submenu and find cross-name duplicates - #130
Conversation
Series > Clean up groups the series-wide data-maintenance operations and adds two scans plus a crash guard. - Remove pixel-dust traces: small closed traces at or below a user-chosen area threshold (um^2, measured the way the object and trace tables measure it), presented in a review list so the user inspects and deselects before anything is deleted. - Remove empty traces: degenerate geometry only (no points, zero-area closed, zero-length open), removed after a count-stating confirmation. - Find duplicates named differently: one shape traced twice under two object names, which the existing same-name pass cannot see because it draws both traces out of a single section.contours[cname]. Reports only; which of the two names is right is a question about the data, not about geometry. - getOverlapRatio answers 0 for a collapsed combined bounding box instead of dividing by zero. Two collinear traces used to raise ZeroDivisionError out of overlaps() and end the whole duplicate pass on the first such pair. Trace.pointsMatch and Trace.ratioIsOverlap are the two halves of overlaps(), extracted so the new scan can report the ratio it measured and still reach the same verdict, and so the point-match tolerance has a name. The bounding-box tests in the scan are slack by that tolerance: two traces can match point for point while their boxes do not touch, and a strict test drops exactly the pairs the comparison would have called duplicates. MalformedContoursDialog gains a column spec, an overridable default sort column and a subclass button hook, so both review lists reuse its selection, navigation, deletion and export behavior. Locked objects are skipped by every scan unless asked for. Removal goes through deleteMalformedTraces, which re-finds each trace by a color plus rounded-points signature, so one confirmation removes exactly the reviewed traces and one undo puts them back. Closes #67 Closes #109
quasiTriestino
left a comment
There was a problem hiding this comment.
I like how the clean up menu is shaping up. It looks good. For simplicity, let's go ahead and collapse "find duplicates named differently" and "remove duplicates" into a single item under the clean-up called "duplicates" that identifies all duplicates (named the same or otherwise) and allows the user to select which to combine into a single trace. Probably there should be a drop-down menu with all the names of the duplicates that they can chose from.
Also, there is a lot of explainer text at the top of the pop-up window. For text like that, reduce to a very simple explanation and put a question mark hover menu next to it with the full explainer.
Series > Clean up > Duplicates... replaces the two duplicate items. One scan lists each structure traced more than once, under one name or several, with a drop-down of its names; combining keeps one trace under the picked name, adds the tags of the others, and deletes the rest as one undo step. Each clean-up list now opens with one line, and the full explanation sits in a ? tooltip beside it. The tests this branch added are removed.
|
Both changes are in. |
Adds a
Clean upsubmenu underSeries.Duplicates...finds traces that overlap, whatever their names, one row per structure with a drop-down of its names. Combining keeps the picked name, carries the other tags over, and removes the rest in one undo step.Remove pixel-dust traces...lists tiny closed traces.Remove empty traces...removes degenerate traces. Each list opens with one line and a?for the full text.Closes #67
Closes #109